<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>simple</title>
    <style>
      :root {
        --page-h: 100vh;
        --color-danger: rgb(194, 29, 29);
        --header-h: 48px;
      }
      .page {
        display: flex;
        flex-direction: column;
        height: var(--page-h);
      }
      .content {
        /* calculate */
        /* height: calc(100vh - 64px); */
        height: calc(var(--page-h) - var(--header-h));
        /* flex: 1; */
        background-color: blue;
      }
      .header {
        height: var(--header-h);
        background-color: var(--color-danger);
      }
    </style>
  </head>
  <body>
    <div class="page">
      <div class="header">xx</div>
      <div class="content">
        <div class="main">
          <div class="item"></div>
          <div></div>
          <div class="item"></div>
          <div class="item"></div>
        </div>
      </div>
    </div>
    <style>
      .main {
        width: 400px;
        height: 400px;
        background-color: chocolate;
      }
      .item {
        width: 50px;
        height: 50px;
      }
      /* .item1{
            background-color: blue
        } */
      .item:nth-of-type(1)
      /* .main :nth-child(1) */ {
        background-color: blue;
      }
      /* .item2{
            background-color: red
        } */
      .item:nth-of-type(3) {
        /* .main :nth-child(2) { */
        background-color: red;
      }
      /* .item3{
            background-color: gray
        } */
      .item:nth-of-type(4) {
        /* .main :nth-child(3) { */
        background-color: rebeccapurple;
      }
    </style>
  </body>
</html>
